package parser;
import java.util.*;
import java.io.*; 
import antlr.RecognitionException;

public class NewClassScope extends LocalScope {
    
    NewClassScope(int name, Scope enclosing) {
        super(enclosing);
        this.name = name;
    }
    
    int name;
      
    Expr name(int name) {
        return new LocalVariable(name, this);
    }
        
    Type variable(int name) {
        if (locals.get(name))
            return new NamedLocal(name);
        else if (enclosing == null) 
            return new GlobalVar(name);
        else
            return escape(name, 0);
    }
    
    Type escape(int name, int depth) {
        // Ignore depth
        return new GeneralLocal(name);
    }
 
}
